package com.weirong.smartvault.backservice.entity_model;

import com.weirong.smartvault.entity.Command;

import java.util.ArrayList;
import java.util.List;

/**
 * 于2017/11/27由 KFEB4 创建 .
 */
public class CommandCollectionModel {
    List<CommandModel> commands;
    public CommandCollectionModel(List<Command> commands){
        this.commands = new ArrayList<>();
        for(Command command:commands){
            this.commands.add(new CommandModel(command));
        }
    }
    public String getDepartmentName(){
        if(commands.size()==0)
            return "";
        return commands.get(0).getDepartmentName();
    }
    public List<CommandModel> getRest(){
        return commands.subList(1,commands.size());
    }
    public Integer size(){
        return commands.size();
    }
    public CommandModel first(){
        return commands.get(0);
    }
    public List<CommandModel> getCommands(){
        return this.commands;
    }
}
